// 判断是否禁用
export const isDisabled = (boolean) => {
  if (boolean === true || boolean === 1) {
    return true;
  }

  if (
    boolean === false ||
    boolean === 0 ||
    boolean === undefined ||
    boolean === null
  ) {
    return false;
  }

  // 其他情况报错
  throw new Error('xtInput Invalid disabled: ' + JSON.stringify(boolean));
};

// 获取占位符文本
export const getPlaceholder = (item, prefix = '请输入') => {
  return `${prefix}${item?.label}`;
};

export const getMaxlength = (item) => {
  return item?.max || 20;
};


// export cosnt rules 